package com.qf.controller.advices;

import com.qf.dto.R;
import com.qf.exceptions.MybaseException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/*
 * @Data: 2021/7/14 17:18
 * */
@ResponseBody
@ControllerAdvice
public class MyControllerAdvice {

    @ExceptionHandler(MybaseException.class)
    public R processMyBaseException(MybaseException exception){
        return R.getR(exception.getCode(), exception.getMessage(),null);
    }
}
